home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / www / autoindex2b.lha / scale.rex < prev   
OS/2 REXX Batch file  |  1997-06-18  |  1KB  |  45 lines

  1. /******************************/
  2. /* Image Engineer Macro       */
  3. /* by Savel                   */
  4. /* Scale a given image by any */
  5. /* size. (c)1997              */
  6. /******************************/
  7. address IMAGEENGINEER
  8. Options results
  9. signal on error         /* Setup a place for errors to go */
  10. if arg()==0 then exit
  11.  
  12. PARSE ARG source dest sizex sizey
  13. /* say source
  14. say dest
  15. say sizex
  16. say sizey
  17. */
  18. 'TYPE 24bit'
  19. OPEN source
  20. Project=RESULT
  21. SCALE Project sizex sizey BEST
  22. Project2=RESULT
  23. Close Project
  24. 'SAVE_DATA 'Project2' 'dest' "JPEG (IJG-JFIF)"'
  25. Close Project2
  26. exit
  27.  
  28. /*******************************************************************/
  29. /* This is where control goes when an error code is returned by IE */
  30. /* It puts up a message saying what happened and on which line     */
  31. /*******************************************************************/
  32. error:
  33. if RC=5 then do         /* Did the user just cancel us? */
  34.    IE_TO_FRONT
  35.    LAST_ERROR
  36.    'REQUEST "'||RESULT||'"'
  37.    exit
  38. end
  39. else do
  40.    IE_TO_FRONT
  41.    LAST_ERROR
  42.    'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  43.    exit
  44. end
  45.